foo =[
    ["zs",19],
    ["ll",54],
    ["wa",17],
    ["df",23],
    ["xf",23]

]
a = sorted(foo,key=lambda x :(x[1],x[0]))
print(a)
a = sorted(foo,key=lambda x :x[0])
print(a)